#@adminLayout()
#define main()
<main class="app-content">
    <div class="app-title">
        <div>
            <h1><i class="fa fa-edit"></i>给全体用户发送消息</h1>
            <p>给全体用户发送消息</p>
        </div>
        <ul class="app-breadcrumb breadcrumb">
            <li class="breadcrumb-item"><a href="/admin"><i class="fa fa-home fa-lg"></i>仪表盘</a></li>
            <li class="breadcrumb-item active"><a href="/admin/user">用户管理</a></li>
            <li class="breadcrumb-item active"><a href="javascript:;">发送全体消息</a></li>
        </ul>
    </div>
    <form action="/admin/user/saveAllSend" method="post" id="myArticleForm">
        <div class="row">
            <div class="col-md-12">
                <div class="tile">
                    <div class="row">
                        <div class="col-lg-8">
                            <h3 class="tile-title">正在给<font style="color: red;">全体用户</font>发送消息</h3>
                            <div class="form-group">
                                <label class="control-label">标题</label>
                                <input class="form-control" type="text" name="title">
                            </div>
                            <div class="form-group">
                                <label class="control-label">内容</label>
                                <textarea class="form-control" rows="4" name="content"
                                          placeholder="请输入内容"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="tile-footer">
                        <input class="btn btn-primary" type="submit" value="提交"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</main>
#end
#define js()
<script type="text/javascript" src="/static/jquery_form/jquery.form.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#myArticleForm").ajaxForm({
            dataType: "json"
            , beforeSubmit: function (formData, jqForm, options) {
            }
            , success: function (ret) {
                if (ret.state == "ok") {
                    location.href = "/admin/user?p=#(p ?? 1)";
                } else {
                    showFailMsg(ret.msg);
                }
            }
            , error: function (ret) {
                alert(ret.statusText);
            }
            , complete: function (ret) {
            } 	      // 无论是 success 还是 error，最终都会被回调
        });
    });
</script>
#end